﻿using System;
using System.Collections.Generic;
using System.Text;
using smartBrowser.Ontology;

namespace smartBrowser.Util
{
    public class Tag
    {
        private String prefix;
        private String concept;
        private String uri;
        private List<State> propertyList;
        private List<State> relationList;
        private int occurence;

        public Tag(String prefix, String concept)
        {
            this.prefix = prefix;
            this.concept = concept;
            this.uri = null;
            this.occurence = 1;            
            this.propertyList = new List<State>();
            this.relationList = new List<State>();
        }

        public Tag(String prefix, String concept, String uri)
        {
            this.prefix = prefix;
            this.concept = concept;                            
            this.uri = uri;
            this.occurence = 1;
            this.propertyList = new List<State>();
            this.relationList = new List<State>();
        }

        public void addProperty(State state)
        {
            if (!this.propertyList.Contains(state))
                this.propertyList.Add(state);
        }

        public void addRelation(State state)
        {
            if (!this.relationList.Contains(state))
                this.relationList.Add(state);
        }

        #region Properties
        
        public String Prefix
        {
            get { return this.prefix; }
        }

        public String Concept
        {
            get { return this.concept; }
        }

        public String Uri
        {
            get
            {                
                return this.uri; 
            }
            
        }

        public int Occurence
        {
            get { return this.occurence; }
            set { this.occurence = value; }
        }

        public List<State> Properties
        {
            get { return this.propertyList; }
        }

        public List<State> RelationList
        {
            get { return this.relationList; }
        }

        #endregion
    }
}
